{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/greengerong/awesome-llm/blob/main/colab/seamless_m4t_colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "id": "VjYy0F2gZIPR",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "88c8fbbb-bef5-4018-cb27-80e4881fa36e"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "/content\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m162.3/162.3 kB\u001b[0m \u001b[31m2.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m20.0/20.0 MB\u001b[0m \u001b[31m77.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.3/2.3 MB\u001b[0m \u001b[31m77.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m118.9/118.9 kB\u001b[0m \u001b[31m14.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m179.2/179.2 kB\u001b[0m \u001b[31m19.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m65.8/65.8 kB\u001b[0m \u001b[31m7.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25h  Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m298.2/298.2 kB\u001b[0m \u001b[31m27.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.4/75.4 kB\u001b[0m \u001b[31m6.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m268.8/268.8 kB\u001b[0m \u001b[31m26.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m50.5/50.5 kB\u001b[0m \u001b[31m5.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m139.9/139.9 kB\u001b[0m \u001b[31m12.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m4.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m59.5/59.5 kB\u001b[0m \u001b[31m7.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m14.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m4.0/4.0 MB\u001b[0m \u001b[31m43.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.2/2.2 MB\u001b[0m \u001b[31m94.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m50.4/50.4 kB\u001b[0m \u001b[31m5.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m46.5/46.5 kB\u001b[0m \u001b[31m4.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m43.7/43.7 kB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m41.0/41.0 kB\u001b[0m \u001b[31m5.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m41.0/41.0 kB\u001b[0m \u001b[31m4.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m87.5/87.5 kB\u001b[0m \u001b[31m11.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m84.5/84.5 kB\u001b[0m \u001b[31m10.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m7.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m67.0/67.0 kB\u001b[0m \u001b[31m8.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m74.5/74.5 kB\u001b[0m \u001b[31m7.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25h  Building wheel for ffmpy (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "  Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m202.8/202.8 kB\u001b[0m \u001b[31m3.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m519.3/519.3 kB\u001b[0m \u001b[31m45.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.3/115.3 kB\u001b[0m \u001b[31m14.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m194.1/194.1 kB\u001b[0m \u001b[31m23.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m134.8/134.8 kB\u001b[0m \u001b[31m392.6 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m98.8/98.8 kB\u001b[0m \u001b[31m12.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.0/3.0 MB\u001b[0m \u001b[31m90.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m468.9/468.9 kB\u001b[0m \u001b[31m34.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25h  Building wheel for seamless-communication (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "/content\n",
            "Cloning into 'seamless_m4t-hf'...\n",
            "remote: Enumerating objects: 45, done.\u001b[K\n",
            "remote: Counting objects: 100% (45/45), done.\u001b[K\n",
            "remote: Compressing objects: 100% (29/29), done.\u001b[K\n",
            "remote: Total 45 (delta 19), reused 37 (delta 15), pack-reused 0\u001b[K\n",
            "Receiving objects: 100% (45/45), 11.44 KiB | 11.44 MiB/s, done.\n",
            "Resolving deltas: 100% (19/19), done.\n",
            "Downloading assets/sample_input.mp3 (10 KB)\n",
            "Error downloading object: assets/sample_input.mp3 (9823696): Smudge error: Error downloading assets/sample_input.mp3 (982369687f05bf8fcd6923c4ffcccda0fcce92f44eceae5a9d00a431f07ea87b): [982369687f05bf8fcd6923c4ffcccda0fcce92f44eceae5a9d00a431f07ea87b] Object does not exist on the server: [404] Object does not exist on the server\n",
            "\n",
            "Errors logged to /content/seamless_m4t-hf/.git/lfs/logs/20230825T045708.896031587.log\n",
            "Use `git lfs logs last` to view the log.\n",
            "error: external filter 'git-lfs filter-process' failed\n",
            "fatal: assets/sample_input.mp3: smudge filter lfs failed\n",
            "warning: Clone succeeded, but checkout failed.\n",
            "You can inspect what was checked out with 'git status'\n",
            "and retry with 'git restore --source=HEAD :/'\n",
            "\n",
            "/content/seamless_m4t-hf\n",
            "--2023-08-25 04:57:09--  https://huggingface.co/spaces/facebook/seamless_m4t/resolve/main/assets/sample_input.mp3\n",
            "Resolving huggingface.co (huggingface.co)... 13.33.33.55, 13.33.33.102, 13.33.33.110, ...\n",
            "Connecting to huggingface.co (huggingface.co)|13.33.33.55|:443... connected.\n",
            "HTTP request sent, awaiting response... 302 Found\n",
            "Location: https://cdn-lfs.huggingface.co/repos/22/29/2229e95dad104ed5fc3c0a7965fcbe2b47992d3f70e969a2631e9ddcbb32ad9e/982369687f05bf8fcd6923c4ffcccda0fcce92f44eceae5a9d00a431f07ea87b?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27sample_input.mp3%3B+filename%3D%22sample_input.mp3%22%3B&response-content-type=audio%2Fmpeg&Expires=1693198629&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY5MzE5ODYyOX19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5odWdnaW5nZmFjZS5jby9yZXBvcy8yMi8yOS8yMjI5ZTk1ZGFkMTA0ZWQ1ZmMzYzBhNzk2NWZjYmUyYjQ3OTkyZDNmNzBlOTY5YTI2MzFlOWRkY2JiMzJhZDllLzk4MjM2OTY4N2YwNWJmOGZjZDY5MjNjNGZmY2NjZGEwZmNjZTkyZjQ0ZWNlYWU1YTlkMDBhNDMxZjA3ZWE4N2I%7EcmVzcG9uc2UtY29udGVudC1kaXNwb3NpdGlvbj0qJnJlc3BvbnNlLWNvbnRlbnQtdHlwZT0qIn1dfQ__&Signature=kBBKT4fndNEX3hwv5NVWOk2S0U%7Ee1cLqH3vi144u4-rbEtBKWwb5%7EZt6HJrplYnfVoRvzwgqwV1GkdreOWBDhnP6orcV07-hf3p6fCB2LdBTeiOz06XN3%7EzzxToGceAI2%7EXc%7EdBVfwch9BzHR7vJKm7SxthljMe2yPLxNG96DYPTadc7WW3BZZIZkAEf-7-CJZcogzbP-V2ZsgqPNLJS78Q5kWZQZfErln3NKRY6U6MM0e0kW04sr3vmy1W0KUwQCo7gwhl1cT-DBa22leBsUtSuNPjm7YMod%7EmQh%7ECvtJpXw-TQjOTP%7EoILIN9tsP5ai8z4AKmG42r6c9xLR%7EGDYg__&Key-Pair-Id=KVTP0A1DKRTAX [following]\n",
            "--2023-08-25 04:57:09--  https://cdn-lfs.huggingface.co/repos/22/29/2229e95dad104ed5fc3c0a7965fcbe2b47992d3f70e969a2631e9ddcbb32ad9e/982369687f05bf8fcd6923c4ffcccda0fcce92f44eceae5a9d00a431f07ea87b?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27sample_input.mp3%3B+filename%3D%22sample_input.mp3%22%3B&response-content-type=audio%2Fmpeg&Expires=1693198629&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY5MzE5ODYyOX19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5odWdnaW5nZmFjZS5jby9yZXBvcy8yMi8yOS8yMjI5ZTk1ZGFkMTA0ZWQ1ZmMzYzBhNzk2NWZjYmUyYjQ3OTkyZDNmNzBlOTY5YTI2MzFlOWRkY2JiMzJhZDllLzk4MjM2OTY4N2YwNWJmOGZjZDY5MjNjNGZmY2NjZGEwZmNjZTkyZjQ0ZWNlYWU1YTlkMDBhNDMxZjA3ZWE4N2I%7EcmVzcG9uc2UtY29udGVudC1kaXNwb3NpdGlvbj0qJnJlc3BvbnNlLWNvbnRlbnQtdHlwZT0qIn1dfQ__&Signature=kBBKT4fndNEX3hwv5NVWOk2S0U%7Ee1cLqH3vi144u4-rbEtBKWwb5%7EZt6HJrplYnfVoRvzwgqwV1GkdreOWBDhnP6orcV07-hf3p6fCB2LdBTeiOz06XN3%7EzzxToGceAI2%7EXc%7EdBVfwch9BzHR7vJKm7SxthljMe2yPLxNG96DYPTadc7WW3BZZIZkAEf-7-CJZcogzbP-V2ZsgqPNLJS78Q5kWZQZfErln3NKRY6U6MM0e0kW04sr3vmy1W0KUwQCo7gwhl1cT-DBa22leBsUtSuNPjm7YMod%7EmQh%7ECvtJpXw-TQjOTP%7EoILIN9tsP5ai8z4AKmG42r6c9xLR%7EGDYg__&Key-Pair-Id=KVTP0A1DKRTAX\n",
            "Resolving cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)... 18.155.68.98, 18.155.68.73, 18.155.68.94, ...\n",
            "Connecting to cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)|18.155.68.98|:443... connected.\n",
            "HTTP request sent, awaiting response... 200 OK\n",
            "Length: 10272 (10K) [audio/mpeg]\n",
            "Saving to: ‘/content/seamless_m4t-hf/assets/sample_input.mp3’\n",
            "\n",
            "/content/seamless_m 100%[===================>]  10.03K  --.-KB/s    in 0s      \n",
            "\n",
            "2023-08-25 04:57:09 (191 MB/s) - ‘/content/seamless_m4t-hf/assets/sample_input.mp3’ saved [10272/10272]\n",
            "\n",
            "--2023-08-25 04:57:09--  https://huggingface.co/spaces/facebook/seamless_m4t/resolve/main/assets/sample_input_2.mp3\n",
            "Resolving huggingface.co (huggingface.co)... 13.33.33.55, 13.33.33.102, 13.33.33.110, ...\n",
            "Connecting to huggingface.co (huggingface.co)|13.33.33.55|:443... connected.\n",
            "HTTP request sent, awaiting response... 302 Found\n",
            "Location: https://cdn-lfs.huggingface.co/repos/22/29/2229e95dad104ed5fc3c0a7965fcbe2b47992d3f70e969a2631e9ddcbb32ad9e/6a505a4641e3f5f0ddec9508832793aa20e63d2545530b66bc04a9bd19a742e6?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27sample_input_2.mp3%3B+filename%3D%22sample_input_2.mp3%22%3B&response-content-type=audio%2Fmpeg&Expires=1693198629&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY5MzE5ODYyOX19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5odWdnaW5nZmFjZS5jby9yZXBvcy8yMi8yOS8yMjI5ZTk1ZGFkMTA0ZWQ1ZmMzYzBhNzk2NWZjYmUyYjQ3OTkyZDNmNzBlOTY5YTI2MzFlOWRkY2JiMzJhZDllLzZhNTA1YTQ2NDFlM2Y1ZjBkZGVjOTUwODgzMjc5M2FhMjBlNjNkMjU0NTUzMGI2NmJjMDRhOWJkMTlhNzQyZTY%7EcmVzcG9uc2UtY29udGVudC1kaXNwb3NpdGlvbj0qJnJlc3BvbnNlLWNvbnRlbnQtdHlwZT0qIn1dfQ__&Signature=hXFC1Nhfk-0eJMlJSeZ2lq0%7EaeKPNZ%7Eu8pFXme5myJScNYzIip2gsABnl5y7X6B27aTCgIWRsquisrX-L5UPICKj52y1cWjLePDdDYqjBimscZRJL6AzU7wnB30M7POqj-kd8LX8BIiLRijiAaXcXTVc6Ohhh3MxVATYUQc5yJjhxnLYBlaPVAFec8%7E7gcnHPwNVPtMPWfCYHnrfwaPhUuWmkBwArS9BmV%7Eaoe7w9ZOerYoikfj72DDYNpe3%7Er1OFSPemK7acbMQtGSilvwUGKjWehdas1P8clqTyCmSz8VX8%7EJye%7EmPOO0WdOeJogTETv7-1ChFRCgA8t9PjCUSvg__&Key-Pair-Id=KVTP0A1DKRTAX [following]\n",
            "--2023-08-25 04:57:09--  https://cdn-lfs.huggingface.co/repos/22/29/2229e95dad104ed5fc3c0a7965fcbe2b47992d3f70e969a2631e9ddcbb32ad9e/6a505a4641e3f5f0ddec9508832793aa20e63d2545530b66bc04a9bd19a742e6?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27sample_input_2.mp3%3B+filename%3D%22sample_input_2.mp3%22%3B&response-content-type=audio%2Fmpeg&Expires=1693198629&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY5MzE5ODYyOX19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5odWdnaW5nZmFjZS5jby9yZXBvcy8yMi8yOS8yMjI5ZTk1ZGFkMTA0ZWQ1ZmMzYzBhNzk2NWZjYmUyYjQ3OTkyZDNmNzBlOTY5YTI2MzFlOWRkY2JiMzJhZDllLzZhNTA1YTQ2NDFlM2Y1ZjBkZGVjOTUwODgzMjc5M2FhMjBlNjNkMjU0NTUzMGI2NmJjMDRhOWJkMTlhNzQyZTY%7EcmVzcG9uc2UtY29udGVudC1kaXNwb3NpdGlvbj0qJnJlc3BvbnNlLWNvbnRlbnQtdHlwZT0qIn1dfQ__&Signature=hXFC1Nhfk-0eJMlJSeZ2lq0%7EaeKPNZ%7Eu8pFXme5myJScNYzIip2gsABnl5y7X6B27aTCgIWRsquisrX-L5UPICKj52y1cWjLePDdDYqjBimscZRJL6AzU7wnB30M7POqj-kd8LX8BIiLRijiAaXcXTVc6Ohhh3MxVATYUQc5yJjhxnLYBlaPVAFec8%7E7gcnHPwNVPtMPWfCYHnrfwaPhUuWmkBwArS9BmV%7Eaoe7w9ZOerYoikfj72DDYNpe3%7Er1OFSPemK7acbMQtGSilvwUGKjWehdas1P8clqTyCmSz8VX8%7EJye%7EmPOO0WdOeJogTETv7-1ChFRCgA8t9PjCUSvg__&Key-Pair-Id=KVTP0A1DKRTAX\n",
            "Resolving cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)... 18.155.68.98, 18.155.68.73, 18.155.68.94, ...\n",
            "Connecting to cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)|18.155.68.98|:443... connected.\n",
            "HTTP request sent, awaiting response... 200 OK\n",
            "Length: 30624 (30K) [audio/mpeg]\n",
            "Saving to: ‘/content/seamless_m4t-hf/assets/sample_input_2.mp3’\n",
            "\n",
            "/content/seamless_m 100%[===================>]  29.91K  --.-KB/s    in 0s      \n",
            "\n",
            "2023-08-25 04:57:09 (76.1 MB/s) - ‘/content/seamless_m4t-hf/assets/sample_input_2.mp3’ saved [30624/30624]\n",
            "\n",
            "Downloading the checkpoint of the model 'seamlessM4T_large'...\n",
            "100% 10.7G/10.7G [00:55<00:00, 207MB/s]\n",
            "Downloading the tokenizer of the model 'seamlessM4T_large'...\n",
            "100% 4.93M/4.93M [00:00<00:00, 220MB/s]\n",
            "Downloading the checkpoint of the model 'vocoder_36langs'...\n",
            "100% 160M/160M [00:00<00:00, 266MB/s]\n",
            "Running on local URL:  http://127.0.0.1:7860\n",
            "Running on public URL: https://07682da8eb2eee795e.gradio.live\n",
            "\n",
            "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n",
            "Keyboard interruption in main thread... closing server.\n",
            "Traceback (most recent call last):\n",
            "  File \"/usr/local/lib/python3.10/dist-packages/gradio/blocks.py\", line 2198, in block_thread\n",
            "    time.sleep(0.1)\n",
            "KeyboardInterrupt\n",
            "\n",
            "During handling of the above exception, another exception occurred:\n",
            "\n",
            "Traceback (most recent call last):\n",
            "  File \"/content/seamless_m4t-hf/app.py\", line 412, in <module>\n",
            "    demo.queue(max_size=50).launch(share=True)\n",
            "  File \"/usr/local/lib/python3.10/dist-packages/gradio/blocks.py\", line 2114, in launch\n",
            "    self.block_thread()\n",
            "  File \"/usr/local/lib/python3.10/dist-packages/gradio/blocks.py\", line 2202, in block_thread\n",
            "    self.server.close()\n",
            "  File \"/usr/local/lib/python3.10/dist-packages/gradio/networking.py\", line 49, in close\n",
            "    self.thread.join()\n",
            "  File \"/usr/lib/python3.10/threading.py\", line 1096, in join\n",
            "    self._wait_for_tstate_lock()\n",
            "  File \"/usr/lib/python3.10/threading.py\", line 1116, in _wait_for_tstate_lock\n",
            "    if lock.acquire(block, timeout):\n",
            "KeyboardInterrupt\n",
            "Killing tunnel 127.0.0.1:7860 <> https://07682da8eb2eee795e.gradio.live\n",
            "^C\n"
          ]
        }
      ],
      "source": [
        "%cd /content\n",
        "!pip install -q fairseq2==0.1.0 gradio==3.40.1\n",
        "!pip install -q git+https://github.com/camenduru/seamless_communication\n",
        "\n",
        "%cd /content\n",
        "!git clone -b dev https://github.com/camenduru/seamless_m4t-hf\n",
        "%cd /content/seamless_m4t-hf\n",
        "\n",
        "!wget https://huggingface.co/spaces/facebook/seamless_m4t/resolve/main/assets/sample_input.mp3 -O /content/seamless_m4t-hf/assets/sample_input.mp3\n",
        "!wget https://huggingface.co/spaces/facebook/seamless_m4t/resolve/main/assets/sample_input_2.mp3 -O /content/seamless_m4t-hf/assets/sample_input_2.mp3\n",
        "\n",
        "!python app.py"
      ]
    }
  ],
  "metadata": {
    "accelerator": "GPU",
    "colab": {
      "gpuType": "T4",
      "provenance": [],
      "include_colab_link": true
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}